package carltechnology.com.mahjonggame.mode;

import carltechnology.com.mahjonggame.utils.Utils;

/**
 * Created by WZTCM on 2016/6/1.
 * when there is no res of data
 * no name list return null
 * no price list return null
 * no id return NONE_ID
 * no unit_price return NONE_UNIT_PRICE
 */
public abstract  class AbstractData implements IData {
    // code for default res
    public enum DATA_RES{
        NONE_ID(-1),
        NONE_UNIT_PRICE(0),
        NONE_COST(0);
        private int code;
        DATA_RES(int state){
            this.code = code;
        }
        public int getCode(){
            return code;
        }
    }
    @Override
    public int getId() {
        return DATA_RES.NONE_ID.getCode();
    }

    @Override
    public int getUnitPrice() {
        return DATA_RES.NONE_UNIT_PRICE.getCode();
    }

    @Override
    public String getDate() {
        return Utils.getTodayDate();
    }

    @Override
    public String[] getName() {
        return null;
    }

    @Override
    public int[] getPrice() {
        return null;
    }

    @Override
    public int getCost() {
        return DATA_RES.NONE_COST.getCode();
    }

    @Override
    public String getSimpleName() {
        return null;
    }
}
